package Text.Work;

import com.sun.xml.internal.ws.policy.privateutil.PolicyUtils;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

/*
 *@Student 张策
 */
public class work1 {
    public static void main(String[] args) {
        new W1().io();
    }
}
class W1{
    public void io(){
        String sttr1="E:\\1705032184538.png";
        String sttr2="e:\\666.png";
        FileInputStream fileInputStream=null;
        FileOutputStream fileOutputStream=null;
        try {
            fileInputStream = new FileInputStream(sttr1);
            fileOutputStream=new FileOutputStream(sttr2);
            byte[]bytes=new byte[1024];
            int num;
            while ((num=fileInputStream.read(bytes))!=-1){
                fileOutputStream.write(bytes,0,num);
            }
            System.out.println("拷贝成功");
        } catch (IOException e) {
            e.printStackTrace();
        }finally {
            try {
                if(fileInputStream!=null){
                    fileInputStream.close();
                }
                if(fileOutputStream!=null){
                    fileOutputStream.close();
                }
            } catch (IOException e) {
                e.printStackTrace();
            }
        }

    }
}
